<?php

namespace app\admin\controller;

use think\Db;
use think\Controller;
class Common extends Controller{
	public function file_upload(){
		if(empty($_FILES)){
			return toError(0,'上传文件为空');
		}
		$img = file_upload('file','./uploads/');
		if($img['code'] == 200){
			return json(['code'=>0,'data'=>['src'=>$img['img_url']]]);
		}
		return json(['code'=>206,'msg'=>'失败']);
	}
	
	
}
?>